import api from "@/libs/BaseApi";
/**
 * @description: 登錄
 * @param {*} uesrName
 * @param {*} password
 * @return {Promise}
 */
export function apiLogin(data) {
  return api.post("/loginApi/login", data, true)
}

export function apiLogin2(data) {
  return api.post("/loginApi/login2", data, true)
}

export function numberLogin(data) {
  return api.post("/loginApi/loginByNumber ", data, true)
}

export function getCheckItem(data) {
  return api.post("/smartHospital/checkApi/getCheckItem", data)
}

export function initId(data) {
  return api.post("/checkApi/init", data)
}

export function photoUpload(file) {
  return api.postImg("/smartHospital/imgApi/profilePhotoUpload", file)
}

export function photoUploadBase64(file) {
  return api.post("/smartHospital/imgApi/imgUploadByBase64", file)
}

export function getImgBase64(file) {
  return api.post("/smartHospital/imgApi/getImgBase64", file)
}

export function submitData(data) {
  return api.post("/smartHospital/wzbxApi/submitData", data)
}

export function submitXgData(data) {
  return api.post("/checkApi/submitXgData", data)
}

export function getCheckRecord(data) {
  return api.post("/smartHospital/checkApi/getCheckRecord", data)
}

export function getCheckRecordCurrent(data) {
  return api.post("/smartHospital/checkApi/getCheckRecordCurrent", data)
}

export function getRecordDetail(data) {
  return api.post("/smartHospital/checkApi/getRecordDetail", data)
}

export function getFireRecordDetail(data) {
  return api.post("/smartHospital/fireApi/getRecordDetail", data)
}

export function userTask(data) {
  return api.post("/checkApi/userTask", data)
}

export function checkAbnormal(data) {
  return api.post("/smartHospital/checkApi/checkAbnormal", data)
}

export function getCheckAbnormal(data) {
  return api.post("/smartHospital/checkApi/getCheckAbnormal", data)
}

export function getLogin(data) {
  return api.post(`/hospitalBase/openApi/loginByPhone`, data,  true)
}

export function dingLogin(data) {
  return api.post("/ding/login", data)
}

export function updateAbnormalHandle(data) {
  return api.post("/smartHospital/checkApi/updateAbnormalHandle", data)
}

export function getSign(data) {
  return api.post("/hospitalBase/openApi/getSign", data, true)
}

export function mobileSecurityCode(data) {
  return api.post("/loginApi/mobileSecurityCode", data)
}

export function getFireTotal(data) {
  return api.post("/smartHospital/fireApi/getFireTotal", data)
}

export function getFireCount(data) {
  return api.post("/smartHospital/fireApi/getFireCount", data)
}

export function getFireRecord(data) {
  return api.post("/smartHospital/fireApi/getFireRecord", data)
}

export function getCheckItemFire(data) {
  return api.post("/smartHospital/fireApi/getCheckItem", data)
}

export function submitDataFire(data) {
  return api.post("/smartHospital/fireApi/submitData", data)
}

export function getRecordDetailFire(data) {
  return api.post("/smartHospital/fireApi/getRecordDetail", data)
}

export function checkRecordXg(data) {
  return api.post("/checkApi/checkRecordXg", data)
}

export function getPlaceName(data) {
  return api.post("/smartHospital/checkApi/getPlaceName", data)
}

export function getFireName(data) {
  return api.post("/smartHospital/fireApi/getFireName", data)
}

export function carRecord(data) {
  return api.post("/carReservation/carRecord", data)
}

export function carUpdate(data) {
  return api.post("/smartHospital/whiteApi/checkRecord", data)
} 

export function loginPhone(data) {
  return api.post(`/hospitalBase/openApi/loginByPhonePwd`, data, true )
}

export function available() {
  return api.get("/tenants/current")
}

export function getTenants(id) {
  return api.get("/tenants/" + id)
}

export function switchTenants(id) {
  return api.post("/tenants/" + id + '/switch')
}

export function pointsForm(id) {
  return api.get("/inspection/points/forms?qrCode=" + id)
}

export function formDetails(id) {
  return api.get("/records/" + id)
}

export function addRecords(data) {
  return api.post("/records", data)
}

export function handleRecords(data) {
  return api.post("/records/handle", data)
}

export function getWxPlace() {
  return api.post("/smartHospital/wzbxApi/getWxPlace", {})
}

export function getWxType() {
  return api.post("/smartHospital/wzbxApi/getWxType", {})
}

export function getAbnormalList(data) {
  return api.post("/smartHospital/wzbxApi/myRepair", data)
}

export function myOrder(data) {
  return api.post("/smartHospital/wzbxApi/myOrder", data)
}

export function myWork(data) {
  return api.post("/smartHospital/wzbxApi/myWork", data)
}

export function ifShowMyWork(data) {
  return api.post("/smartHospital/wzbxApi/ifShowMyWork", data)
}

export function getAbnormalDetail(data) {
  return api.post("/smartHospital/wzbxApi/getAbnormalDetail", data)
}

export function updateData(data) {
  return api.post("/smartHospital/wzbxApi/updateData", data)
}

export function orderButton(data) {
  return api.post("/smartHospital/wzbxApi/orderButton", data)
}

export function latestCycle() {
  return api.get("/inspection/plans/latest-cycle", {}, 'third')
}

export function getUserInfo() {
  return api.get("/inspection/users/me", {}, 'third')
}

export function getCycles(id) {
  return api.get(`/inspection/plans/${id}/cycles`, {}, 'third')
}

export function getPlanDetail(id) {
  return api.get(`/inspection/plans/${id}`, {}, 'third')
}

export function getPoints(id, time) {
  return api.get(`/inspection/plans/${id}/points?cycleStart=${time}`, {}, 'third')
}

export function getRecords(params) {
  return api.get(`/inspection/records`, params, 'third')
}

export function filesUpload(formData, type) {
  return api.postImg(`/inspection/files/upload?type=${type}`, formData, 'third')
}

export function getRecordsId(id) {
  return api.get(`/inspection/records/${id}`, {}, 'third')
}

export function recordHandle(data) {
  return api.post(`/inspection/records/handle`, data, 'third')
}

export function submitRecord(data) {
  return api.post(`/inspection/records`, data, 'third')
}

// 设备状态统计
export function deviceStat() {
  return api.post(`/energy/dataBoard/deviceStat`, {})
}

// 分页查询设备
export function selectDevicePage(data) {
  return api.post(`/energy/dataBoard/selectDevicePage`, data)
}

// 设备日数据统计
export function findDeviceInfo(type) {
  return api.post(`/energy/dataBoard/findDeviceInfo`, { type: type })
}

// 日用量统计图
export function findDayInfoChart(data) {
  return api.post(`/energy/dataBoard/findDayInfoChart`, data)
}

// 报警日数据统计图
export function findDayWarningLogChart(data) {
  return api.post(`/energy/dataBoard/findDayWarningLogChart`, data)
}

// 报警数据统计
export function findWarningLogInfoChart() {
  return api.post(`/energy/dataBoard/findWarningLogInfoChart`, {})
}

// 月消耗同比数据
export function findMonthEnergyMoMChart(data) {
  return api.post(`/energy/dataBoard/findMonthEnergyMoMChart`, data)
}

// 日消耗同比统计图
export function findDayEnergyMoMChart(data) {
  return api.post(`/energy/dataBoard/findDayEnergyMoMChart`, data)
}

// 年消耗同比统计图
export function findYearEnergyMoMChart(data) {
  return api.post(`/energy/dataBoard/findYearEnergyMoMChart`, data)
}

// 科室消耗同比统计图
export function findDeptEnergyChart(data) {
  return api.post(`/energy/dataBoard/findDeptEnergyChart`, data)
}

// 分页查询报警记录
export function selectWarningLogPage(data) {
  return api.post(`/energy/dataBoard/selectWarningLogPage`, data)
}

// 设备能耗统计表
export function findDeviceEnergyChart() {
  return api.post(`/energy/dataBoard/findDeviceEnergyChart`, {})
}

export function getWarningLot(data) {
  return api.post(`/energy/warningLog/getWarningLog`, data)
}

// 大屏工单列表
export function repairCommunicationData(data) {
  return api.post(`/smartHospital/repairCommunicationApi/getData`, data, 'auth')
}

export function submitHiddentrouble(data) {
  return api.post("/smartHospital/checkApi/submitHiddentrouble", data)
}

export function getHiddentrouble(data) {
  return api.post("/smartHospital/checkApi/getHiddentrouble", data)
}

export function hiddentroubleList(data) {
  return api.post("/smartHospital/checkApi/hiddentroubleList", data)
}

export function updateHiddentrouble(data) {
  return api.post("/smartHospital/checkApi/updateHiddentrouble", data)
}

export function selectPlanByPage(data) {
  return api.post("/businessExamine/exam/selectPlanByPage", data)
}

export function getPaperQuestion(data) {
  return api.post("/businessExamine/exam/getPaperQuestion", data)
}

export function examAdd(data) {
  return api.post("/businessExamine/exam/add", data)
}

export function selectAnswer(data) {
  return api.post("/businessExamine/exam/selectAnswer", data)
}

export function selectPaperStatic(data) {
  return api.post("/businessExamine/dataBoard/selectPaperStatic", data)
}

export function selectPlanStatic(data) {
  return api.post("/businessExamine/dataBoard/selectPlanStatic", data)
}